package net.seabookchen.dao;

import java.util.List;

import net.seabookchen.pojo.Wish;

import com.googlecode.objectify.ObjectifyService;
import com.googlecode.objectify.Query;

public class WishDao extends ObjectifyGenericDao<Wish> {
	static {
		ObjectifyService.register(Wish.class);
	}
	

	public WishDao(Class<Wish> clazz) {
		super(clazz);
	}
	
	public List<Wish> listWishes(int index) {
		Query<Wish> wishes = ofy().query(Wish.class).order("-created").limit(index);
		return deadOrLive(wishes);
	}
	
	public List<Wish> listWishes() {
		Query<Wish> wishes = ofy().query(Wish.class).order("-created");
		return deadOrLive(wishes);
	}
}
